#include "Matrizen.h"

void skamatxy (double sx, double sy,  double mat[3][3])	//Matrix zum Skalieren
{
   mat[0][0] = sx;
   mat[0][1] = 0;
   mat[0][2] = 0;

   mat[1][0] = 0;
   mat[1][1] = sy;
   mat[1][2] = 0;

   mat[2][0] = 0;
   mat[2][1] = 0;
   mat[2][2] = 1;
}


void tramatxy (double dx, double dy,  double mat[3][3])	//Matrix zum Verschieben
{
   mat[0][0] = 1;
   mat[0][1] = 0;
   mat[0][2] = dx;

   mat[1][0] = 0;
   mat[1][1] = 1;
   mat[1][2] = dy;

   mat[2][0] = 0;
   mat[2][1] = 0;
   mat[2][2] = 1;
}



void rotmatxy (double winkel, double mat[][3])	//Matrix zum Drehen
{
   double bogenmass;
   double pi = 3.14159265358979;

   bogenmass = pi * winkel / 180. ;

   mat[0][0] = cos(bogenmass);
   mat[0][1] = sin(bogenmass);
   mat[0][2] = 0;

   mat[1][0] = -sin(bogenmass);
   mat[1][1] = cos(bogenmass);
   mat[1][2] = 0;

   mat[2][0] = 0;
   mat[2][1] = 0;
   mat[2][2] = 1;
}



void matvek(double mat[3][3], double pv[], double pn[])
{

	pn[0]=pv[0]*mat[0][0]+pv[1]*mat[0][1]+pv[2]*mat[0][2];
	pn[1]=pv[0]*mat[1][0]+pv[1]*mat[1][1]+pv[2]*mat[1][2];
	pn[2]=pv[0]*mat[2][0]+pv[1]*mat[2][1]+pv[2]*mat[2][2];

}


